/*
 * Neigh.h
 *
 *  Created on: Aug 8, 2011
 *      Author: marchi
 */

#ifndef NEIGH_H_
#define NEIGH_H_
#include <set>
using std::multiset;

class Neigh {
protected:
	class MyData{
	public:
		double dist;
		int n;
		bool operator()(const MyData & x, const MyData & y){return x.dist<y.dist;};
	};
public:
	typedef multiset<MyData,MyData>::iterator iterator;
	Neigh();
	virtual ~Neigh(){neigh.clear();};
	void insert(const double & rsq, const int & o){MyData temp;temp.dist=rsq;temp.n=o;neigh.insert(temp);};
	iterator  begin(){return neigh.begin();};
	iterator  end(){return neigh.end();};
private:
	multiset<MyData,MyData> neigh;
};

#endif /* NEIGH_H_ */
